import 'dart:core';

import 'package:floor/floor.dart';

///客户账单

@entity
class CustomerBill{
  @PrimaryKey(autoGenerate: true)
  int? id; //建表的时候，可为空, 就会自动生成可自增的id

  String customerName = ''; //客户名称
  String customerPhone = ''; //电话
  String customerAddress = ''; //地址

  int subtotalFee = 0; //价格小计
  int discount= 0;//折扣
  int price= 0;//价格 = 价格小计 - 折扣
  int billDeposit= 0;//定金
  int billBalance= 0;//尾款 = 价格 - 定金
  String billDesc = ''; //订单的描述

  String column1 = ''; //扩展字段1
  String column2 = '';
  String column3 = '';
  DateTime createTime;//创建时间
  DateTime updateTime;//更新时间
  int isDelete = 0; //是否删除，0-未删除，1-删除

  CustomerBill(
      {this.id,
      this.customerName = '',
      this.customerPhone = '',
      this.customerAddress = '',

      this.subtotalFee = 0,
      this.discount = 0,
      this.price = 0,
      this.billDeposit = 0,
      this.billBalance = 0,
        this.billDesc = '',

      this.column1 = '',
      this.column2 = '',
      this.column3 = '',
      required this.createTime,
      required this.updateTime,
      this.isDelete = 0});

  Map<String, Object> toJson() {
    Map<String, Object> map = {};
    map['id'] = (id ??= -1);
    map['customerName'] = customerName;
    map['customerPhone'] = customerPhone;
    map['createTime'] = createTime;
    map['updateTime'] = updateTime;
    map['billDesc'] = billDesc;
    return map;
  }


}